package ru.sviridov.sellandbuy;

import java.util.HashMap;
import java.util.Map;

import android.app.Activity;

public class ContentViewMapper {
	
	private static Map<Class<? extends Activity>,Integer> contentViewMap = createMap();

	private static Map<Class<? extends Activity>,Integer>  createMap() {
		Map<Class<? extends Activity>,Integer>  map = new HashMap<Class<? extends Activity>,Integer> (12);
		map.put(LoginActivity.class, R.layout.page_login);
		map.put(MainActivity.class, R.layout.page_main);
		map.put(RegisterActivity.class, R.layout.page_register);
		map.put(RestoreActivity.class, R.layout.page_restore);
		map.put(ProfileActivity.class, R.layout.page_profile);
		map.put(ChangePasswordActivity.class, R.layout.page_change_password);
		map.put(ChooseAddressActivity.class, R.layout.page_address);
		map.put(NewAdvertisingActivity.class, R.layout.page_new_advertising);
		map.put(ChooseCategoryActivity.class, R.layout.page_category);		
		
		return map;
	}
	

	public static void setContentView(Activity activity) {
		int layoutId = contentViewMap.get(activity.getClass());
		activity.setContentView(layoutId);
	}
	
}
